#include "SoundManager.h"

void SoundManager::playMusic(const char* name, bool loop) {
	CocosDenshion::SimpleAudioEngine::getInstance()->playBackgroundMusic(name,loop);
}
void SoundManager::pauseMusic() {
	CocosDenshion::SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
}
void SoundManager::preloadEffect(const char* name) {
	CocosDenshion::SimpleAudioEngine::getInstance()->preloadEffect(name);
}
unsigned int SoundManager::playEffect(const char* name) {
	return CocosDenshion::SimpleAudioEngine::getInstance()->playEffect(name);
}
void SoundManager::stopAllEffect() {
	CocosDenshion::SimpleAudioEngine::getInstance()->stopAllEffects();
}
void SoundManager::preloadMusic(const char* name) {
	CocosDenshion::SimpleAudioEngine::getInstance()->preloadBackgroundMusic(name);
}
void SoundManager::stopMusic(bool releaseData) {
	CocosDenshion::SimpleAudioEngine::getInstance()->stopBackgroundMusic(releaseData);
}
void SoundManager::resumeMusic() {
	CocosDenshion::SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
}

void SoundManager::stopEffect(unsigned int soundId) {
	CocosDenshion::SimpleAudioEngine::getInstance()->stopEffect(soundId);
}	

void SoundManager::muteSound() {
	CocosDenshion::SimpleAudioEngine::getInstance()->setEffectsVolume(0.0f);
}
void SoundManager::muteMusic() {
	CocosDenshion::SimpleAudioEngine::getInstance()->setBackgroundMusicVolume(0.0f);
}

void SoundManager::setBackgroundMusicVolume(float volume) {
	CocosDenshion::SimpleAudioEngine::getInstance()->setBackgroundMusicVolume(volume);
}

float SoundManager::getBackgroundMusicVolume() {
	CocosDenshion::SimpleAudioEngine::getInstance()->getBackgroundMusicVolume();
}